import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:sow_app/repository/pref_cache_repository.dart';
import 'package:sow_app/util/share_preferences/preferences.dart';
import 'package:sow_app_core/sow_app_core.dart';

void main() async {
  group('cache repository test group', () {
    SharedPreferences.setMockInitialValues({});

    CacheRepository repository = PrefCacheRepository(Preferences());

    test(
      "should return true when invoke setToken()",
      () async {
        // arrange

        // act

        await repository.set('hello', "world");

        // assert
      },
    );
    test(
      "should return token String when invoke get()",
      () async {
        // arrange

        // act
        var result = await repository.get("hello");
        // assert
        expect(result, isA<String>());
        expect(result, isNotEmpty);
        expect(result, 'world');
      },
    );
  });
}
